/**
 * 
 */
package com.quydat.forum.managedbeans;

import javax.ejb.EJB;

import com.quydat.forum.entites.UserEntity;
import com.quydat.forum.entites.UserGroupEntity;
import com.quydat.forum.interfaces.UserEntityManageLocal;
import com.quydat.forum.interfaces.UserGroupEntityManageLocal;

/**
 * @author Dat
 *
 */
public class UserRegister {
@EJB
private UserEntityManageLocal userManage;
@EJB
private UserGroupEntityManageLocal userGroupManage;

private UserEntity userEntity;
public String addUser()
{
	UserGroupEntity userGroup=userGroupManage.findUserGroupEntitybyId(1);
	userEntity.setUserGroup(userGroup);
	userManage.addUserEntity(userEntity);
	return"";
	
}
public UserEntity getUserEntity() {
	if(userEntity==null)
	{
		userEntity=new UserEntity();
		
	}
	return userEntity;
}
public void setUserEntity(UserEntity userEntity) {
	this.userEntity = userEntity;
}

}
